<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCruiseOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_order', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo', 60)->default('')->comment('开店订单号');
            $table->unsignedInteger('shopId')->default(0)->comment('门店ID');
            $table->unsignedInteger('templateId')->default(0)->comment('模板id');
            $table->unsignedInteger('handlerId')->default(0)->comment('当前处理人id(仅列表输出用)');
            $table->unsignedInteger('type')->default(1)->comment('任务类型 1：新店帮扶');
            $table->unsignedInteger('status')->default(0)->comment('当前状态');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->index('orderNo', 'idx_orderNo');
            $table->comment = '巡店 - 主表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_new_shop_help');
    }
}
